from flask import Flask, session
import json


app=Flask(__name__, static_url_path='')

from src.router.login import bp as login
from src.router.register import bp as register
from src.router.main_router import bp as main_router

from const import session_key
from src.router.login import checklogin
app.register_blueprint(login)
app.register_blueprint(register)
app.register_blueprint(main_router)

app.secret_key = session_key
app.debug = True



@app.route('/')
@checklogin
def hello_world():
    data={'code':1,'mess':''}
    # return render_template("index.html")
    name  = session.get('user')
    logining='你好：' + name
    data['mess'] = logining
    return json.dumps(data)



 



if __name__ == '__main__':
    app.run(host="127.0.0.1", port="8080")
